package com.bill99.datasourceconfig;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

@Component
class WebConfigurer extends WebMvcConfigurerAdapter {
   @Value("${ipo.tracker.excel.uploadPath}")
   private String uploadConfig;
   @Value("${tableau.view.pic.uploadPath}")
   private String uploadPath;

   @Override
   public void addResourceHandlers(ResourceHandlerRegistry registry) {
      registry.addResourceHandler("/ipoTrackerExcel/**").addResourceLocations("file:///"+uploadConfig);
      registry.addResourceHandler("/tableauViewPic/**").addResourceLocations("file:///"+uploadPath);
   }
}